<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<button id="submit" onclick="sub()">获取信息</button>
<script>
    function sub() {
        $.get("/rtest/getAll", function (data) {
            if (data.hasOwnProperty("code")&&data.code === 500){
                console.log(data.msg);
                return;
            }
            console.log(data.msg);
            console.log(data.data);
        })
    }
</script>
</body>
</html>